package com.coocaa.app.lib.cleaner.localapp;

import android.content.ComponentName;
import android.text.TextUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by admin on 2016/8/29.
 */
public class XLaunchComponent {
    private String packageName, className;
    private String label;
//    private Drawable icon;
    private List<String> categories = new ArrayList<String>();

    public String getPackageName() {
        return packageName;
    }

    public void setPackageName(String packageName) {
        this.packageName = packageName;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

//    public Drawable getIcon() {
//        return icon;
//    }
//
//    public void setIcon(Drawable icon) {
//        this.icon = icon;
//    }

    public List<String> getCategories() {
        return categories;
    }

    public void setCategories(List<String> categories) {
        this.categories = categories;
    }

    public boolean containCategory(String category) {
        if (TextUtils.isEmpty(category))
            return false;
        return categories.contains(category);
    }

    public ComponentName getComponent() {
        if (!TextUtils.isEmpty(packageName) && !TextUtils.isEmpty(className))
            return new ComponentName(packageName, className);
        return null;
    }

}
